Colorful Circles

Author

Hans Lehndorff

Parameters

This is a random simulation of colorful circles. Each frame represents a “year” and the simulation last 1,000 years.

Growth

Each circle grows by 1 unit each year and increase by 1 in terms of “age” . At initialization each circle have ages/sizes between 1 and 5.

Death

However there is a chance that each circle will “die off”. The odds that a circle dies off is equivalent to age in age + lifespan. In this simulation the lifespan is 50 years. That is, at an age of 50 the colorful circles have a 50% of dying off. Circles of age 1 will not die off.

Color

At initialization, each colorful circle is assigned a random color from the RGB colorspace. These colors scale between 0 and 1 and represent the percent that a color is made up of R, G and B.

Replication

In this simulation there is a 12% chance in each year that a colorful circle and it nearest neighbor will produce an offspring. The offspring will:

  • have a size of 1

  • have an age of 1

  • the average position of the parents plus some error

Offspring color

Offspring will have the average color (in terms of RGB) of the two parent circles. However, there is a chance, that this color will change. Specifically, for each color (R, G, and B) there is a chance equivalent to the strength of each color that that color will become up to 20% stronger, while the other colors will become 20% weaker. That is, strong greens are likely to become stronger green (and less red, and less blue).

Result

Colorful circles animation

Show code
# tree_plot<-ggplot(tree_dat)+
  # geom_circle(aes(x0=x,y0=y,r=t,fill=factor(tree)),alpha=1)+
  # scale_fill_manual(values = tree_dat$color)+
  # coord_fixed(xlim = x_range,ylim = y_range)+
  # guides(fill='none')+
  # theme_void()+
  # transition_states(year)+
  # ease_aes("linear")

# animate(tree_plot,nframes = years*2,duration = years/10,end_pause = 10,renderer = gifski_renderer())